<template>
  <div class="form-config-container">
    <el-form label-position="top" size="small" class="form_config">
      <el-form-item :label="$t('fm.config.form.name')">
        <el-input v-model="data.name" placeholder="" clearable />
      </el-form-item>
      <el-form-item :label="$t('fm.config.form.code')">
        <el-input v-model="data.code" placeholder="" clearable />
      </el-form-item>
      <el-form-item :label="$t('fm.config.form.descript')">
        <el-input v-model="data.descript" placeholder="" clearable />
      </el-form-item>

      <el-form-item :label="$t('fm.config.form.labelPosition.title')">
        <el-radio-group v-model="data.config.labelPosition">
          <el-radio-button label="left">
            {{ $t('fm.config.form.labelPosition.left') }}
          </el-radio-button>
          <el-radio-button label="right">
            {{ $t('fm.config.form.labelPosition.right') }}
          </el-radio-button>
          <el-radio-button label="top">
            {{ $t('fm.config.form.labelPosition.top') }}
          </el-radio-button>
        </el-radio-group>
      </el-form-item>

      <el-form-item :label="$t('fm.config.form.labelWidth')">
        <el-input-number
          v-model="data.config.labelWidth"
          :min="0"
          :max="200"
          :step="10"
        />
      </el-form-item>

      <el-form-item :label="$t('fm.config.form.size')">
        <el-radio-group v-model="data.config.size">
          <el-radio-button label="medium">medium</el-radio-button>
          <el-radio-button label="small">small</el-radio-button>
          <el-radio-button label="mini">mini</el-radio-button>
        </el-radio-group>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  props: {
    data: {
      type: Object,
      default: () => ({ config: {} }),
    },
  },
  methods: {
    confirm() {},
    cancel() {},
  },
}
</script>

<style lang="scss" scoped>
.form-config-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.form_config {
  flex: 1;
}
</style>
